﻿using Core.Domain.Companys;
using System.Data.Entity.ModelConfiguration;

namespace Data.Mapping.Companys
{
    public partial class CompanyAttributeMap : EntityTypeConfiguration<CompanyAttribute>
    {
        public CompanyAttributeMap()
        {
            this.ToTable("Company_Attribute_Mapping");
            this.HasKey(s => s.Id);
                        
            this.HasRequired(pp => pp.Company)
                .WithMany(p => p.CompanyAttribute)
                .HasForeignKey(pp => pp.CompanyId);

            this.HasRequired(pp=>pp.Attribute)
                .WithMany()
                .HasForeignKey(pp=>pp.AttributeId);            

        }
    }
}
